package zipcode;

//import admin.AdminDAOOracle;
//import project.web.admin.AdminException;
import zipcode.ZipcodeException;
import zipcode.ZipcodeTO;

import zipcode.ZipcodeDAOOracle;

import java.sql.SQLException;

import javax.naming.NamingException;
import java.util.ArrayList;

public class ZipcodeControl {

	private ZipcodeDAOOracle getDAOOracle() throws  ZipcodeException {
			
			 try{
			
				   return new ZipcodeDAOOracle();
			 } catch ( NamingException ne ){

					throw new ZipcodeException( ne.getMessage( )  );
			 }
		}//end

	public ArrayList getZipList(String dong) throws ZipcodeException, SQLException{
		ZipcodeDAOOracle daoDB = getDAOOracle();

		 try{
				return daoDB.getZipList(dong);
		 } catch ( SQLException sqle ){
				throw new ZipcodeException( sqle.getMessage() );
		 } // end try ~ catch
	}

}//end class